#ifndef ObjectReader_H
#define ObjectReader_H
#include<fstream>
#include<vector>
#include"HashMap.h"
#include<cstring>
#include<cstdio>
#include<sstream>
using namespace std;

class ObjectReader{
private:
	FILE* in;
public:
	ObjectReader(const char* file);
	~ObjectReader();
	bool readBool();
	int readInt();
	string* readString();

	template<class T> inline int readArray(T* &v){
		int size = readInt();
		v = new T[size];
		fread(v, sizeof(T), size, in);
		return size;
	}

	void readVector(vector<int> &v);
	void readVector(vector<string*> &v);
	void readVector(vector<vector<string*>*> &v);
	void readMap(HashMap &Map);
	long objTell();
	int objSeek(long _Offset);
};
#endif
